import request from '../utils/request.js'
// 登录
export function loginApi({mobile,code}) {
  return request({
    url: '/v1_0/authorizations',
    method: 'POST',
    data: {
      mobile,
      code
    }
  })
}

// 登录(续签新的token)
export function getNewToken() {
  return request({
    url: '/v1_0/authorizations',
    method: 'PUT',
    headers:{
      // 没请求体的参数需要带,请求头写不写都无所谓
      // 'Content-Type':'application/x-www-form-urlencoded',
      Authorization: 'Bearer ' + localStorage.getItem('refresh')
    }
  })
}